<%@ page contentType="text/html;charset=UTF-8" %>
<html>
<head>
    <title></title>
    <link rel="stylesheet" type="text/css" href="<g:createLinkTo dir="css" file="main.css"/>">
    <link rel="stylesheet" type="text/css" href="<g:createLinkTo dir="css" file="errors.css"/>">
    <link rel="stylesheet" type="text/css" href="<g:createLinkTo dir="css" file="mobile.css"/>">
    <script src="../js/jquery-2.1.0.js"></script>
    <script src="../js/application.js"></script>
</head>

<body>
<div id="form">
    <form action="<g:createLink action="createPersonAction" controller="person"/> ">
        <g:if test="${person}">
            <g:hiddenField name="id" value="${person.id}"/>

        </g:if>
        <input type="text" name="name" placeholder="EnterName"  pattern="^[A-ZА-Я][a-zа-я]+$" value="${person?.name ?: ''}">
        <br>
        <input type="text" name="age" placeholder="EnterAge" value="${person?.age ?: ''}">
        <br>
        <g:datePicker name="date" precision="day" value="${person?.date ?: ''}"/>

        <br>
        <input type="text" name="city" placeholder="EnterCity" value="${person?.address?.city ?: ''}">
        <br>
        <input type="text" name="street" placeholder="EnterStreet" value="${person?.address?.street ?: ''}">
        <br>
        <input type="text" name="number" placeholder="EnterHome" value="${person?.address?.number ?: ''}">
        <br>
        <br>
        <input type="submit">

    </form>
    <br>
    <g:include action="show"/>
    <br>
    <input type="button" class="button" value="delete" onclick="deleteData('<g:createLink action="deletePerson"/>')">

    <input type="button" class="button" value="change" onclick="changePerson('<g:createLink action="changePerson"/>')">
</div>

</body>
</html>